Computer memories, like all electronic systems, are prone to various failures throughout their lifetimes. It is desirable to avoid the loss of important data when a memory failure occurs. Accordingly, it is necessary to test these memories either periodically or on demand during their useful lives, so that proper memory functioning is assured before data to be relied upon is stored in them.
Testing a memory generally involves writing data into the memory, reading it back, and checking to see that the retrieved data matches the data that was written. Any data that resides in the memory prior to such testing is over-written during the test, and thus is lost. To avoid loss of useful data, then, it is generally desirable to test a memory when it is "empty", i.e., when it is not storing any data currently in use. A good time for testing main memory in a computer, for example, is immediately upon power-up but prior to loading operating system software.
Unfortunately, it is not always possible to test a memory when it is empty. For example, the memory may be part of a "server" computer that is generally always operating. In such a computer, significant portions of memory are always in use by the operating system, and thus are never empty during normal operation. There are likewise many other examples where data is forced to stay in a particular location in memory indefinitely. This situation implies the need to periodically test memory despite the presence of data that is currently being used.
The present invention is directed to this general need to test memories that are storing in-use data.
There are known techniques to accomplish memory testing in the presence of in-use data. According to one general method, the memory test is just run, and the memory contents are destroyed. Such a technique can only be used if it is possible to somehow re-establish the memory contents after running the test. In general, such capability implies that a "shadow" copy of the memory contents is stored elsewhere. Although there are some special examples of memory systems where such shadow copies can be found, such as in systems using write-through caches, the vast majority of memory systems do not enjoy this luxury. Therefore this technique has limited applicability.
According to a second technique, the entire memory to be tested is copied elsewhere, the memory test is performed, and then the memory contents are restored. This technique has the advantages of safety and simplicity. However, it interrupts the use of memory for an extended time, and thus can degrade system performance. It also can require a significant amount of backup storage to hold the copy of memory if the memory to be tested is large.
A third technique is to either wait for non-restorable data to be expunged or to force such expunging periodically, and then test memory. This technique assumes that the data is "dynamic", i.e., only stored in memory when needed and then written out to a backing store. Accordingly, this third technique won't work at all on "static" data, i.e., data that stays in memory indefinitely. Also, this technique can degrade system performance by unduly delaying testing or by expunging critical data when needed by the processor.